package nc.ui.arap.selectedpay;

import nc.ui.arap.pubdj.ARAPDjCardPanel;
import nc.ui.pub.beans.UIRefPane;
import nc.vo.ep.dj.DJZBItemVO;
public class CorrespListenerImp implements CorrespListener {
  public CorrespListenerImp() {
  }
  public void corresp(CorrespEvent e) {
    /**@todo Implement this nc.ui.arap.selectedpay.CorrespListener method*/
    //throw new java.lang.UnsupportedOperationException("Method corresp() not yet implemented.");
    ARAPDjCardPanel source=(ARAPDjCardPanel)e.getSource();
    String key=e.getKey();
    if(source.getBillCardPanelDj().getBodyItem(key)!=null)
    {
      Object value=null;
      if(source.getBillCardPanelDj().getBodyItem(key).getComponent() instanceof UIRefPane)
      {
        value=((UIRefPane)source.getBillCardPanelDj().getBodyItem(key).getComponent()).getRefCode();
      }
      else
      {
          value=source.getBillCardPanelDj().getHeadItem(key).getValueObject();
      }
      int row=source.getBillCardPanelDj().getRowCount();
      for(int i=0;i<row;i++)
      {
        source.getBillCardPanelDj().setBodyValueAt(value,i,key);
        source.getBillCardPanelDj().getBillModel().execLoadFormula();

        ((DJZBItemVO)(((MainPanel)source.getM_Parent()).fkd.getChildrenVO()[i])).setAttributeValue(key,value);
      }
    }
  }



}
